package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextPane;
import java.awt.Font;
import java.awt.Component;
import java.awt.FlowLayout;
import javax.swing.JTextField;
import javax.swing.Box;
import java.awt.Dimension;
import javax.swing.JTextArea;

import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Rectangle;
import javax.swing.JScrollPane;
import java.awt.Insets;


import javax.swing.JOptionPane;

import javax.swing.JButton;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

import Entita.Interpretazione;
import Entita.Paziente;
import Report.PDFGenerator;

import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.JList;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import javax.swing.JTabbedPane;


public class Protocollo extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private class JComboBoxManifestazioni extends JComboBox{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		JComboBoxManifestazioni(){
			this.setModel(new DefaultComboBoxModel(new String[] {"", "CS", "AB", "AC", "AU", "CE", "CZ", "CO"}));
			this.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
			this.setVisible(false);
		}
	}
	


	private JPanel contentPane;
	private JNumberTextField textField;
	private JNumberTextField textField_1;
	private JComboBox cbManifestazioni2;
	private JComboBox cbManifestazioni3;
	private JComboBox cbManifestazioni4;
	private JComboBox cbManifestazioni5;
	private JComboBox cbManifestazioni1;
	private JComboBox cbSuccessioni1;
	private JComboBox cbSuccessioni2;
	private JComboBox cbSuccessioni3;
	private JTextArea tRaccolta;
	private JComboBox cbPosizione;
	private JTextArea tInchiesta;
	private JComboBox cbChoc1;
	private JComboBox cbChoc2;

   
    private JComboBox cbDP;
    private JComboBox cbComprensione;
    private Paziente paziente;
    private JComboBox cbTipodp;
    private JComboBox cbQADP;
    private JComboBox cbDSM;
    private JComboBox cbDSMT;
    private JComboBox cbDSc;
    private JComboBox cbDSQA;
    private JComboBox cbDSfc;
    private JComboBox cbDSC;
    private JTextField testoContenutiPrimari;
    private JComboBox cbContenutiPrimari;
    private JTextField testoContenutiSecondari1;
    private JComboBox cbFrequenze;
    private JComboBox cbContenutiSecondari1;
    private JComboBox cbContenutiSecondari2;
    private JComboBox cbContenutiSecondari3;
    private JComboBox cbContenutiSecondari4;
    private JComboBox cbContenutiSecondari5;
    private JComboBox cbQFrequenze;
    private	boolean colore=false;
    private JComboBox cbRifiuto;
    private JList list;
    private JComboBox cbNumeroLocalizzazione;
    private JTextField textField_2;
    
    private void checkQF(){
		cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Ad", "As", "Ads", "H", "Hd", "Hs", "Hds", "Obj", "Anat", "SexF", "SexM", "SexC", "Sex?", "SexA", "SexsM", "SexsF", "SexsC", "Sexs?", "SexsA", "Schel", "Rad", "Patol", "Sang", "Abstr", "Arald", "Arch", "Ark", "Astr", "Biol", "Bot", "Cibo", "Col", "Ele", "Esc", "Espl", "Fig", "Foc", "Geog", "Ghiac", "Masch", "Min", "Nat", "Nub", "Pal", "Paes", "Poz", "Scena", "Sign", "Spo", "Altro", "Carne", "Vorago", "Ombra", "Ven"}));
		cbDSC.setModel(new DefaultComboBoxModel(new String[] {"", "FC'n", "C'nF", "C'n"}));
		cbDSfc.setModel(new DefaultComboBoxModel(new String[] {"", "F(c)+", "F(c)-"}));
		cbDSc.setModel(new DefaultComboBoxModel(new String[] {"", "Fc", "cF", "c"}));
    	String str=(String)cbQFrequenze.getSelectedItem();
		if (cbQFrequenze.getSelectedIndex()==0)
			cbComprensione.setEnabled(false);
		else
			cbComprensione.setEnabled(true);
		if(str=="+"){
			cbFrequenze.setModel(new DefaultComboBoxModel(new String[] {"","V","(V)","O+","(O+)","V(O+)","(V)(O+)"}));
			cbComprensione.removeItem("Dr");
			cbComprensione.removeItem("DG");
			cbComprensione.removeItem("DdG");
			cbComprensione.removeItem("DD");
			cbComprensione.removeItem("DdD");
			cbComprensione.removeItem("DGim");
			cbComprensione.removeItem("DdGim");
			cbComprensione.removeItem("DGDdim");
			cbComprensione.removeItem("DdGDdim");
			cbDP.removeItem("F-");
			cbDP.removeItem("F\u00B1");
			cbDP.removeItem("CN");
			cbDP.removeItem("Clob");
			cbDP.removeItem("F(C)-");
			cbDP.removeItem("CM");
			cbDP.removeItem("CClob");
			cbDP.removeItem("C'bClob");
			cbDP.removeItem("C/Clob");
			cbDP.removeItem("CF(C)");
			cbDP.removeItem("(C)Clob");
			cbDP.removeItem("C'bF(C)");
			cbDP.removeItem("C/F(C)");
			cbDP.removeItem("CClob(C)");
			cbDP.removeItem("C/Clob(C)");
			cbDP.removeItem("C�bClob(C)");
			cbDP.removeItem("Po");
			cbDP.removeItem("Num");

			cbDSC.removeItem("C'n");
			cbDSC.removeItem("C'nF");
			cbDSfc.removeItem("F(c)-");
			cbDSc.removeItem("cF");
			cbDSc.removeItem("c");
			cbContenutiPrimari.removeItem("Col");
			cbContenutiPrimari.removeItem("Ele");
			cbContenutiPrimari.removeItem("Esc");
			cbContenutiPrimari.removeItem("Poz");
			cbContenutiPrimari.removeItem("Spo");
			cbContenutiPrimari.removeItem("Carne");
			cbContenutiPrimari.removeItem("Vorago");
			cbContenutiPrimari.removeItem("Ven");
			cbContenutiSecondari1.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Chele", "Cibo", "Cop", "Corna", "Denti", "Dita",  "Ermaf", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze",  "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Tenaglie", "Transex", "Travest", "Unghie", "Vest", "Zanne"}));
			cbContenutiSecondari2.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Chele", "Cibo", "Cop", "Corna", "Denti", "Dita",  "Ermaf", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze",  "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Tenaglie", "Transex", "Travest", "Unghie", "Vest", "Zanne"}));
			cbContenutiSecondari3.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Chele", "Cibo", "Cop", "Corna", "Denti", "Dita",  "Ermaf", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze",  "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Tenaglie", "Transex", "Travest", "Unghie", "Vest", "Zanne"}));
			cbContenutiSecondari4.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Chele", "Cibo", "Cop", "Corna", "Denti", "Dita",  "Ermaf", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze",  "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Tenaglie", "Transex", "Travest", "Unghie", "Vest", "Zanne"}));
			cbContenutiSecondari5.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Chele", "Cibo", "Cop", "Corna", "Denti", "Dita",  "Ermaf", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze",  "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Tenaglie", "Transex", "Travest", "Unghie", "Vest", "Zanne"}));

		}else{
			cbContenutiSecondari1.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Carne", "Chele", "Cibo", "Col", "Cop", "Corna", "Denti", "Dita", "Ele", "Ermaf", "Esc", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze", "Poz", "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Spo", "Tenaglie", "Transex", "Travest", "Unghie", "Ven", "Vest", "Vorago", "Zanne"}));
			cbContenutiSecondari2.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Carne", "Chele", "Cibo", "Col", "Cop", "Corna", "Denti", "Dita", "Ele", "Ermaf", "Esc", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze", "Poz", "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Spo", "Tenaglie", "Transex", "Travest", "Unghie", "Ven", "Vest", "Vorago", "Zanne"}));
			cbContenutiSecondari3.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Carne", "Chele", "Cibo", "Col", "Cop", "Corna", "Denti", "Dita", "Ele", "Ermaf", "Esc", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze", "Poz", "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Spo", "Tenaglie", "Transex", "Travest", "Unghie", "Ven", "Vest", "Vorago", "Zanne"}));
			cbContenutiSecondari4.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Carne", "Chele", "Cibo", "Col", "Cop", "Corna", "Denti", "Dita", "Ele", "Ermaf", "Esc", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze", "Poz", "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Spo", "Tenaglie", "Transex", "Travest", "Unghie", "Ven", "Vest", "Vorago", "Zanne"}));
			cbContenutiSecondari5.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Carne", "Chele", "Cibo", "Col", "Cop", "Corna", "Denti", "Dita", "Ele", "Ermaf", "Esc", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze", "Poz", "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Spo", "Tenaglie", "Transex", "Travest", "Unghie", "Ven", "Vest", "Vorago", "Zanne"}));
			if(str=="-"){
				cbFrequenze.setModel(new DefaultComboBoxModel(new String[] {"","O-","(O-)"}));
				cbComprensione.removeItem("Di");
				cbDP.removeItem("F+");
				cbDP.removeItem("F\u00B1");
				cbDP.removeItem("F(C)+");
				cbDSC.removeItem("FC'n");
				cbDSfc.removeItem("F(c)+");
				cbDSc.removeItem("Fc");
			}else if(str=="\u00B1"){
				cbFrequenze.setModel(new DefaultComboBoxModel(new String[] {"","O\u00B1","(O\u00B1)","(V)(O\u00B1)"}));
				cbDP.removeItem("F+");
				cbDP.removeItem("F-");
				cbDP.removeItem("Po");
				cbDP.removeItem("Num");
				cbDP.removeItem("CN");
				cbDP.removeItem("Clob");
				cbDSC.removeItem("C'n");
				cbDSc.removeItem("c");
			}
		}
    }
	

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Protocollo frame = new Protocollo();
					frame.setVisible(true);
				} catch (Exception e) {
					JOptionPane.showMessageDialog(null,"Errore:"+e.getMessage(),"Errore",JOptionPane.ERROR_MESSAGE);
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Protocollo() {
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(10, 10, 800, 649);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panel = new JPanel();
		panel.setFocusable(false);
		panel.setAlignmentX(Component.LEFT_ALIGNMENT);
		panel.setAlignmentY(Component.TOP_ALIGNMENT);
		contentPane.add(panel, BorderLayout.CENTER);
		
		JPanel panel_1 = new JPanel();
		panel_1.setFocusable(false);
		panel_1.setBounds(10, 10, 50, 50);
		panel_1.setBorder(null);
		panel_1.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnRifiuto = new JTextPane();
		txtpnRifiuto.setFocusable(false);
		txtpnRifiuto.setEditable(false);
		txtpnRifiuto.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnRifiuto.setOpaque(false);
		txtpnRifiuto.setVerifyInputWhenFocusTarget(false);
		txtpnRifiuto.setText("Rifiuto");
		panel_1.add(txtpnRifiuto);
		
		cbRifiuto = new JComboBox();
		cbRifiuto.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if(cbRifiuto.getSelectedIndex()==0)
					colore=false;
				else
					colore=true;
				cbComprensione.setSelectedIndex(0);
					
					
			}
		});
		cbRifiuto.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_1.add(cbRifiuto);
		cbRifiuto.setModel(new DefaultComboBoxModel(new String[] {"No", "S\u00EC"}));
		
		JPanel panel_2 = new JPanel();
		panel_2.setFocusable(false);
		panel_2.setBounds(70, 10, 65, 50);
		panel_2.setBorder(null);
		panel_2.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnTLatenza = new JTextPane();
		txtpnTLatenza.setFocusable(false);
		txtpnTLatenza.setVerifyInputWhenFocusTarget(false);
		txtpnTLatenza.setText("T. Latenza");
		txtpnTLatenza.setOpaque(false);
		txtpnTLatenza.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnTLatenza.setEditable(false);
		panel_2.add(txtpnTLatenza);
		
		textField = new JNumberTextField(4,JNumberTextField.NUMERIC);
		textField.setSize(new Dimension(40, 25));
		textField.setMinimumSize(new Dimension(30, 20));
		textField.setPreferredSize(new Dimension(40, 25));
		textField.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent arg0) {
				if(textField_1.getText().isEmpty()){
					textField_1.setText(textField.getText());
				}
				if(Integer.parseInt(textField_1.getText())<Integer.parseInt(textField.getText())){
					JOptionPane.showMessageDialog(contentPane,"Il tempo totale deve essere superiore o uguale al tempo di latenza!\nIl valore verr� reimpostato");
					textField_1.setText(textField.getText());					
				}
			}
		});
		textField.setAllowNegative(false);
		textField.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_2.add(textField);
		textField.setColumns(4);
		
		JPanel panel_3 = new JPanel();
		panel_3.setFocusable(false);
		panel_3.setBounds(145, 10, 54, 50);
		panel_3.setBorder(null);
		panel_3.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnTTotale = new JTextPane();
		txtpnTTotale.setFocusable(false);
		txtpnTTotale.setVerifyInputWhenFocusTarget(false);
		txtpnTTotale.setText("T. Totale");
		txtpnTTotale.setOpaque(false);
		txtpnTTotale.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnTTotale.setEditable(false);
		panel_3.add(txtpnTTotale);
		
		textField_1 = new JNumberTextField(4,JNumberTextField.NUMERIC);
		textField_1.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				if(Integer.parseInt(textField_1.getText())<Integer.parseInt(textField.getText())){
					JOptionPane.showMessageDialog(contentPane,"Il tempo totale deve essere superiore o uguale al tempo di latenza!\nIl valore verr� reimpostato");
					textField_1.setText(textField.getText());					
				}
			}
		});
		textField_1.setPreferredSize(new Dimension(40, 25));
		textField_1.setAllowNegative(false);
		textField_1.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		textField_1.setColumns(4);
		panel_3.add(textField_1);
		
		JPanel panel_4 = new JPanel();
		panel_4.setFocusable(false);
		panel_4.setBounds(209, 10, 140, 50);
		panel_4.setBorder(null);
		panel_4.setLayout(new GridLayout(0, 1, 0, 0));
		
		JTextPane txtpnSuccessioni = new JTextPane();
		txtpnSuccessioni.setFocusable(false);
		txtpnSuccessioni.setVerifyInputWhenFocusTarget(false);
		txtpnSuccessioni.setText("Successioni");
		txtpnSuccessioni.setOpaque(false);
		txtpnSuccessioni.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnSuccessioni.setEditable(false);
		panel_4.add(txtpnSuccessioni);
		
		JPanel panel_5 = new JPanel();
		FlowLayout flowLayout_4 = (FlowLayout) panel_5.getLayout();
		flowLayout_4.setVgap(0);
		panel_4.add(panel_5);
		
		cbSuccessioni1 = new JComboBox();
		cbSuccessioni1.addActionListener(new ActionListener() {
			@SuppressWarnings("unchecked")
			public void actionPerformed(ActionEvent e) {
				JComboBox current=(JComboBox) e.getSource();
				if(current.getSelectedIndex()<=0){
					cbSuccessioni2.setEnabled(false);
					cbSuccessioni2.setSelectedIndex(0);
				}
				else
					cbSuccessioni2.setEnabled(true);
			}
		});
		cbSuccessioni1.setModel(new DefaultComboBoxModel(new String[] {"", "P", "N", "I"}));
		panel_5.add(cbSuccessioni1);
		cbSuccessioni1.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		
		cbSuccessioni2 = new JComboBox();
		cbSuccessioni2.setEnabled(false);
		cbSuccessioni2.addActionListener(new ActionListener() {
			@SuppressWarnings("unchecked")
			public void actionPerformed(ActionEvent e) {
				JComboBox current=(JComboBox) e.getSource();
				if(current.getSelectedIndex()<=0){
					cbSuccessioni3.setEnabled(false);
					cbSuccessioni3.setSelectedIndex(0);
				}
				else
					cbSuccessioni3.setEnabled(true);
			}
		});
		cbSuccessioni2.setModel(new DefaultComboBoxModel(new String[] {"", "P", "N", "I"}));
		cbSuccessioni2.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_5.add(cbSuccessioni2);
		
		cbSuccessioni3 = new JComboBox();
		cbSuccessioni3.setEnabled(false);
		cbSuccessioni3.setModel(new DefaultComboBoxModel(new String[] {"", "P", "N", "I"}));
		cbSuccessioni3.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_5.add(cbSuccessioni3);
		
		JPanel panel_6 = new JPanel();
		panel_6.setFocusable(false);
		panel_6.setBounds(359, 10, 113, 50);
		panel_6.setBorder(null);
		panel_6.setLayout(new GridLayout(0, 1, 0, 0));
		
		JTextPane txtpnChoc = new JTextPane();
		txtpnChoc.setFocusable(false);
		txtpnChoc.setVerifyInputWhenFocusTarget(false);
		txtpnChoc.setText("Choc");
		txtpnChoc.setOpaque(false);
		txtpnChoc.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnChoc.setEditable(false);
		panel_6.add(txtpnChoc);
		
		JPanel panel_7 = new JPanel();
		FlowLayout flowLayout_6 = (FlowLayout) panel_7.getLayout();
		flowLayout_6.setVgap(0);
		panel_6.add(panel_7);
		
		cbChoc1 = new JComboBox();
		cbChoc1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (cbChoc1.getSelectedIndex()==0){
					cbChoc2.setSelectedIndex(0);
					cbChoc2.setEnabled(false);
				}else
					cbChoc2.setEnabled(true);
			}
		});
		cbChoc1.setModel(new DefaultComboBoxModel(new String[] {"", "AV", "BU", "CT", "NE", "SX"}));
		cbChoc1.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_7.add(cbChoc1);
		
		cbChoc2 = new JComboBox();
		cbChoc2.setEnabled(false);
		cbChoc2.setModel(new DefaultComboBoxModel(new String[] {"", "AV", "BU", "CT", "NE", "SX"}));
		cbChoc2.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_7.add(cbChoc2);
		
		JPanel panel_8 = new JPanel();
		panel_8.setFocusable(false);
		panel_8.setPreferredSize(new Dimension(10, 50));
		panel_8.setBounds(484, 11, 280, 50);
		panel_8.setMaximumSize(new Dimension(300, 32767));
		panel_8.setAlignmentX(Component.LEFT_ALIGNMENT);
		panel_8.setBorder(null);
		panel_8.setLayout(new GridLayout(0, 1, 0, -10));
		
		JTextPane txtpnManifestazioniParticolari = new JTextPane();
		txtpnManifestazioniParticolari.setFocusable(false);
		txtpnManifestazioniParticolari.setVerifyInputWhenFocusTarget(false);
		txtpnManifestazioniParticolari.setText("Manifestazioni particolari");
		txtpnManifestazioniParticolari.setOpaque(false);
		txtpnManifestazioniParticolari.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnManifestazioniParticolari.setEditable(false);
		panel_8.add(txtpnManifestazioniParticolari);
		
		JPanel panel_9 = new JPanel();
		panel_9.setFocusable(false);
		panel_9.setSize(new Dimension(300, 0));
		panel_9.setBounds(new Rectangle(0, 0, 300, 0));
		panel_9.setAlignmentY(Component.TOP_ALIGNMENT);
		panel_9.setAlignmentX(Component.LEFT_ALIGNMENT);
		FlowLayout flowLayout_8 = (FlowLayout) panel_9.getLayout();
		flowLayout_8.setAlignment(FlowLayout.LEFT);
		panel_8.add(panel_9);
		
		cbManifestazioni1 = new JComboBox();
		cbManifestazioni1.addActionListener(new ActionListener() {
			@SuppressWarnings("unchecked")
			public void actionPerformed(ActionEvent e) {
				JComboBox current=(JComboBox) e.getSource();
				if(current.getSelectedIndex()<=0){
					cbManifestazioni2.setEnabled(false);
					cbManifestazioni2.setSelectedIndex(0);
				}
				else
					cbManifestazioni2.setEnabled(true);
			}
		});
		cbManifestazioni1.setModel(new DefaultComboBoxModel(new String[] {"", "CS", "AB", "AC", "AU", "CE", "CZ", "CO"}));
		cbManifestazioni1.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_9.add(cbManifestazioni1);
		
		cbManifestazioni2 = new JComboBox();
		cbManifestazioni2.addActionListener(new ActionListener() {
			@SuppressWarnings("unchecked")
			public void actionPerformed(ActionEvent e) {
				JComboBox current=(JComboBox) e.getSource();
				if(current.getSelectedIndex()<=0){
					cbManifestazioni3.setEnabled(false);
					cbManifestazioni3.setSelectedIndex(0);
				}
				else
					cbManifestazioni3.setEnabled(true);
			}
		});
		cbManifestazioni2.setModel(new DefaultComboBoxModel(new String[] {"", "CS", "AB", "AC", "AU", "CE", "CZ", "CO"}));
		cbManifestazioni2.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		cbManifestazioni2.setEnabled(false);
		panel_9.add(cbManifestazioni2);
		
		cbManifestazioni3 = new JComboBox();
		cbManifestazioni3.addActionListener(new ActionListener() {
			@SuppressWarnings("unchecked")
			public void actionPerformed(ActionEvent e) {
				JComboBox current=(JComboBox) e.getSource();
				if(current.getSelectedIndex()<=0){
					cbManifestazioni4.setEnabled(false);
					cbManifestazioni4.setSelectedIndex(0);
				}
				else
					cbManifestazioni4.setEnabled(true);
			}
		});
		cbManifestazioni3.setModel(new DefaultComboBoxModel(new String[] {"", "CS", "AB", "AC", "AU", "CE", "CZ", "CO"}));
		cbManifestazioni3.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		cbManifestazioni3.setEnabled(false);
		panel_9.add(cbManifestazioni3);
		
		cbManifestazioni4 = new JComboBox();
		cbManifestazioni4.addActionListener(new ActionListener() {
			@SuppressWarnings("unchecked")
			public void actionPerformed(ActionEvent e) {
				JComboBox current=(JComboBox) e.getSource();
				if(current.getSelectedIndex()<=0){
					cbManifestazioni5.setEnabled(false);
					cbManifestazioni5.setSelectedIndex(0);
				}
				else
					cbManifestazioni5.setEnabled(true);
			}
		});
		cbManifestazioni4.setModel(new DefaultComboBoxModel(new String[] {"", "CS", "AB", "AC", "AU", "CE", "CZ", "CO"}));
		cbManifestazioni4.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		cbManifestazioni4.setEnabled(false);
		panel_9.add(cbManifestazioni4);
		
		cbManifestazioni5 = new JComboBox();
		cbManifestazioni5.setModel(new DefaultComboBoxModel(new String[] {"", "CS", "AB", "AC", "AU", "CE", "CZ", "CO"}));
		cbManifestazioni5.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		cbManifestazioni5.setEnabled(false);
		panel_9.add(cbManifestazioni5);
		
		JComboBoxManifestazioni cb=new JComboBoxManifestazioni();
		cb.setVisible(true);
		panel_9.add(cb);
		panel.setLayout(null);
		panel.add(panel_1);
		panel.add(panel_2);
		panel.add(panel_3);
		panel.add(panel_4);
		panel.add(panel_6);
		panel.add(panel_8);
		
		JPanel panel_14 = new JPanel();
		panel_14.setFocusable(false);
		panel_14.setBounds(10, 71, 370, 175);
		panel.add(panel_14);
		panel_14.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_15 = new JPanel();
		panel_15.setFocusable(false);
		FlowLayout flowLayout = (FlowLayout) panel_15.getLayout();
		flowLayout.setVgap(0);
		flowLayout.setHgap(1);
		flowLayout.setAlignment(FlowLayout.LEFT);
		panel_14.add(panel_15, BorderLayout.NORTH);
		
		JTextPane txtpnRaccolta = new JTextPane();
		txtpnRaccolta.setFocusable(false);
		panel_15.add(txtpnRaccolta);
		txtpnRaccolta.setVerifyInputWhenFocusTarget(false);
		txtpnRaccolta.setText("Raccolta");
		txtpnRaccolta.setOpaque(false);
		txtpnRaccolta.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnRaccolta.setEditable(false);
		
		Component horizontalStrut = Box.createHorizontalStrut(20);
		panel_15.add(horizontalStrut);
		
		JButton button_1 = new JButton("\u2191");
		button_1.setFocusable(false);
		button_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2191 ");
				cbPosizione.setSelectedIndex(0);
			}
		});
		button_1.setPreferredSize(new Dimension(20, 20));
		button_1.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_1);
		
		JButton button_2 = new JButton("\u2193");
		button_2.setFocusable(false);
		button_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2193 ");
				cbPosizione.setSelectedIndex(1);
			}
		});
		button_2.setPreferredSize(new Dimension(20, 20));
		button_2.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_2);
		
		JButton btnNewButton = new JButton("\u2190");
		btnNewButton.setFocusable(false);
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2190 ");
				cbPosizione.setSelectedIndex(2);
			}
		});
		btnNewButton.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(btnNewButton);
		btnNewButton.setPreferredSize(new Dimension(20, 20));
		
		JButton button = new JButton("\u2192");
		button.setFocusable(false);
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2192 ");
				cbPosizione.setSelectedIndex(3);
			}
		});
		button.setPreferredSize(new Dimension(20, 20));
		button.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button);
		
		JButton button_3 = new JButton("\u2196");
		button_3.setFocusable(false);
		button_3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2196 ");
				cbPosizione.setSelectedIndex(4);
			}
		});
		button_3.setPreferredSize(new Dimension(20, 20));
		button_3.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_3);
		
		JButton button_4 = new JButton("\u2197");
		button_4.setFocusable(false);
		button_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2197 ");
				cbPosizione.setSelectedIndex(4);
			}
		});
		button_4.setPreferredSize(new Dimension(20, 20));
		button_4.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_4);
		
		JButton button_5 = new JButton("\u2199");
		button_5.setFocusable(false);
		button_5.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2199 ");
				cbPosizione.setSelectedIndex(4);
			}
		});
		button_5.setPreferredSize(new Dimension(20, 20));
		button_5.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_5);
		
		JButton button_6 = new JButton("\u2198");
		button_6.setFocusable(false);
		button_6.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u2198 ");
				cbPosizione.setSelectedIndex(4);
			}
		});
		button_6.setPreferredSize(new Dimension(20, 20));
		button_6.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_6);
		
		JButton button_7 = new JButton("\u21BA");
		button_7.setFocusable(false);
		button_7.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u21BA ");
			}
		});
		button_7.setPreferredSize(new Dimension(20, 20));
		button_7.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_7);
		
		JButton button_8 = new JButton("\u21BB");
		button_8.setFocusable(false);
		button_8.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tRaccolta.setText(tRaccolta.getText() + " \u21BB ");
			}
		});
		button_8.setPreferredSize(new Dimension(20, 20));
		button_8.setMargin(new Insets(0, 0, 0, 0));
		panel_15.add(button_8);
		
		tRaccolta = new JTextArea();
		tRaccolta.addKeyListener(new KeyAdapter() {
			@Override
			public void keyPressed(KeyEvent e) {
				    if(e.getKeyCode() == java.awt.event.KeyEvent.VK_TAB) {
				    	JTextArea source= (JTextArea) e.getSource();
				        //source.setText(str);
				        if (e.getKeyCode() == KeyEvent.VK_TAB) {
		                    if (e.getModifiers() > 0) {
		                        source.transferFocusBackward();
		                    } else {
		                        source.transferFocus();
		                    }
		                    e.consume();
		                }
				    }
			}
		});
		tRaccolta.setLineWrap(true);
		
		
		JScrollPane scrollPane_1 = new JScrollPane(tRaccolta);
		scrollPane_1.setFocusable(false);
		scrollPane_1.setPreferredSize(new Dimension(300, 150));
		panel_14.add(scrollPane_1, BorderLayout.CENTER);
		
		JPanel panel_10 = new JPanel();
		panel_10.setFocusable(false);
		panel_10.setBounds(394, 71, 370, 175);
		panel.add(panel_10);
		panel_10.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_11 = new JPanel();
		panel_11.setFocusable(false);
		FlowLayout flowLayout_1 = (FlowLayout) panel_11.getLayout();
		flowLayout_1.setAlignment(FlowLayout.LEFT);
		flowLayout_1.setVgap(0);
		flowLayout_1.setHgap(1);
		panel_10.add(panel_11, BorderLayout.NORTH);
		
		JTextPane txtpnInchiesta = new JTextPane();
		txtpnInchiesta.setFocusable(false);
		txtpnInchiesta.setVerifyInputWhenFocusTarget(false);
		txtpnInchiesta.setText("Inchiesta");
		txtpnInchiesta.setOpaque(false);
		txtpnInchiesta.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnInchiesta.setEditable(false);
		panel_11.add(txtpnInchiesta);
		
		Component horizontalStrut_1 = Box.createHorizontalStrut(20);
		panel_11.add(horizontalStrut_1);
		
		JButton button_9 = new JButton("\u2191");
		button_9.setFocusable(false);
		button_9.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2191 ");
					cbPosizione.setSelectedIndex(0);
			}
		});
		button_9.setPreferredSize(new Dimension(20, 20));
		button_9.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_9);
		
		JButton button_10 = new JButton("\u2193");
		button_10.setFocusable(false);
		button_10.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2193 ");
					cbPosizione.setSelectedIndex(1);
			}
		});
		button_10.setPreferredSize(new Dimension(20, 20));
		button_10.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_10);
		
		JButton button_11 = new JButton("\u2190");
		button_11.setFocusable(false);
		button_11.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2190 ");
					cbPosizione.setSelectedIndex(2);
			}
		});
		button_11.setPreferredSize(new Dimension(20, 20));
		button_11.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_11);
		
		JButton button_12 = new JButton("\u2192");
		button_12.setFocusable(false);
		button_12.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2192 ");
					cbPosizione.setSelectedIndex(3);
			}
		});
		button_12.setPreferredSize(new Dimension(20, 20));
		button_12.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_12);
		
		JButton button_13 = new JButton("\u2196");
		button_13.setFocusable(false);
		button_13.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2196 ");
					cbPosizione.setSelectedIndex(4);
			}
		});
		button_13.setPreferredSize(new Dimension(20, 20));
		button_13.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_13);
		
		JButton button_14 = new JButton("\u2197");
		button_14.setFocusable(false);
		button_14.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2197 ");
					cbPosizione.setSelectedIndex(4);
			}
		});
		button_14.setPreferredSize(new Dimension(20, 20));
		button_14.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_14);
		
		JButton button_15 = new JButton("\u2199");
		button_15.setFocusable(false);
		button_15.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2199 ");
					cbPosizione.setSelectedIndex(4);
			}
		});
		button_15.setPreferredSize(new Dimension(20, 20));
		button_15.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_15);
		
		JButton button_16 = new JButton("\u2198");
		button_16.setFocusable(false);
		button_16.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u2198 ");
					cbPosizione.setSelectedIndex(4);
			}
		});
		button_16.setPreferredSize(new Dimension(20, 20));
		button_16.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_16);
		
		JButton button_17 = new JButton("\u21BA");
		button_17.setFocusable(false);
		button_17.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u21BA ");
			}
		});
		button_17.setPreferredSize(new Dimension(20, 20));
		button_17.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_17);
		
		JButton button_18 = new JButton("\u21BB");
		button_18.setFocusable(false);
		button_18.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					tInchiesta.setText(tInchiesta.getText() + " \u21BB ");
			}
		});
		button_18.setPreferredSize(new Dimension(20, 20));
		button_18.setMargin(new Insets(0, 0, 0, 0));
		panel_11.add(button_18);
		
		JScrollPane scrollPane = new JScrollPane((Component) null);
		scrollPane.setFocusable(false);
		scrollPane.setPreferredSize(new Dimension(300, 150));
		panel_10.add(scrollPane, BorderLayout.CENTER);
		
		tInchiesta = new JTextArea();
		tInchiesta.addKeyListener(new KeyAdapter() {
			@Override
			public void keyPressed(KeyEvent e) {
				    if(e.getKeyCode() == java.awt.event.KeyEvent.VK_TAB) {
				    	JTextArea source= (JTextArea) e.getSource();
				        //source.setText(str);
				        if (e.getKeyCode() == KeyEvent.VK_TAB) {
		                    if (e.getModifiers() > 0) {
		                        source.transferFocusBackward();
		                    } else {
		                        source.transferFocus();
		                    }
		                    e.consume();
		                }
				    }
			}
		});
		tInchiesta.setLineWrap(true);
		scrollPane.setViewportView(tInchiesta);
		
		JTextPane txtpnLocalizzazioni = new JTextPane();
		txtpnLocalizzazioni.setFocusable(false);
		txtpnLocalizzazioni.setBounds(61, 251, 81, 22);
		panel.add(txtpnLocalizzazioni);
		txtpnLocalizzazioni.setVerifyInputWhenFocusTarget(false);
		txtpnLocalizzazioni.setText("Localizzazioni");
		txtpnLocalizzazioni.setOpaque(false);
		txtpnLocalizzazioni.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnLocalizzazioni.setEditable(false);
		
		JPanel panel_12 = new JPanel();
		panel_12.setFocusable(false);
		panel_12.setBounds(61, 270, 65, 48);
		panel.add(panel_12);
		panel_12.setBorder(null);
		panel_12.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnPosizione = new JTextPane();
		txtpnPosizione.setFocusable(false);
		panel_12.add(txtpnPosizione);
		txtpnPosizione.setVerifyInputWhenFocusTarget(false);
		txtpnPosizione.setText("Posizione");
		txtpnPosizione.setOpaque(false);
		txtpnPosizione.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnPosizione.setEditable(false);
		
		cbPosizione = new JComboBox();
		cbPosizione.setModel(new DefaultComboBoxModel(new String[] {"", "C", "S", "D", "O"}));
		cbPosizione.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_12.add(cbPosizione);
		
		JPanel panel_13 = new JPanel();
		panel_13.setFocusable(false);
		panel_13.setBorder(null);
		panel_13.setBounds(126, 270, 104, 48);
		panel.add(panel_13);
		panel_13.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnMComprensione = new JTextPane();
		txtpnMComprensione.setFocusable(false);
		txtpnMComprensione.setVerifyInputWhenFocusTarget(false);
		txtpnMComprensione.setText("M. Comprensione");
		txtpnMComprensione.setOpaque(false);
		txtpnMComprensione.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnMComprensione.setEditable(false);
		panel_13.add(txtpnMComprensione);
		
		cbComprensione = new JComboBox();
		cbComprensione.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String str= (String)cbComprensione.getSelectedItem();
				cbDP.setEnabled(false);
				
				if (cbComprensione.getSelectedIndex()==0){
					cbDP.setSelectedIndex(0);
				}else if (str=="Di"){
					cbDP.setModel(new DefaultComboBoxModel(new String[] {"","F+"}));
					cbDP.setSelectedIndex(1);
				}
				else{
					cbDP.setModel(new DefaultComboBoxModel(new String[] {"", "F+", "F-", "F\u00B1", "M", "FC", "CF", "C", "FC'b", "C'bF", "C'b", "F/C", "C/F", "CN", "FClob", "ClobF", "Clob", "F(C)+", "F(C)-", "MC", "CM", "MC'b", "M/C", "MClob", "ClobC", "CClob", "ClobC'b", "C'bClob", "Clob/C", "C/Clob", "MClobC", "MClobC'b", "MClob(C)C'b", "M(C)", "F(C)/C", "CF(C)", "Clob(C)", "(C)Clob", "MClob(C)", "MClob/C", "F(C)C'b", "C'bF(C)", "F(C)C", "C/F(C)", "MC(C)", "M/C(C)", "MC'b(C)", "MClob(C)C", "MClob(C)/C", "MClob(C)C\u2019b", "Clob(C)C", "CClob(C)", "Clob(C)/C", "C/Clob(C)", "Clob(C)C\u2019b", "C\u2019bClob(C)", "Po", "Num"}));
					if (!colore||str=="Dim"||str=="Ddim"){
						cbDP.removeItem("FC");
						cbDP.removeItem("CF");
						cbDP.removeItem("C");
						cbDP.removeItem("F/C");
						cbDP.removeItem("C/F");
						cbDP.removeItem("CN");
						cbDP.removeItem("MC");
						cbDP.removeItem("CM");
						cbDP.removeItem("M/C");
						cbDP.removeItem("ClobC");
						cbDP.removeItem("CClob");
						cbDP.removeItem("Clob/C");
						cbDP.removeItem("C/Clob");
						cbDP.removeItem("MClobC");
						cbDP.removeItem("CF(C)");
						cbDP.removeItem("F(C)C");
						cbDP.removeItem("C/F(C)");
						cbDP.removeItem("F(C)/C");
						cbDP.removeItem("MC(C)");
						cbDP.removeItem("M/C(C)");
						cbDP.removeItem("MClob(C)C");
						cbDP.removeItem("MClob(C)/C");
						cbDP.removeItem("MClob/C");
						cbDP.removeItem("Clob(C)C");
						cbDP.removeItem("Clob(C)/C");
						cbDP.removeItem("C/Clob(C)");
					}
					if (str=="Dim"||str=="Ddim"){
						cbDP.removeItem("FClob");
						cbDP.removeItem("ClobF");
						cbDP.removeItem("Clob");
						cbDP.removeItem("MClob");
						cbDP.removeItem("ClobC");
						cbDP.removeItem("CClob");
						cbDP.removeItem("ClobC'b");
						cbDP.removeItem("C'bClob");
						cbDP.removeItem("Clob/C");
						cbDP.removeItem("C/Clob");
						cbDP.removeItem("MClobC");
						cbDP.removeItem("MClobC'b");
						cbDP.removeItem("MClob(C)C'b");
						cbDP.removeItem("Clob(C)");
						cbDP.removeItem("(C)Clob");
						cbDP.removeItem("MClob(C)");
						cbDP.removeItem("MClob/C");
						cbDP.removeItem("MClob(C)C");
						cbDP.removeItem("MClob(C)/C");
						cbDP.removeItem("MClob(C)C�b");
						cbDP.removeItem("Clob(C)C");
						cbDP.removeItem("CClob(C)");
						cbDP.removeItem("Clob(C)/C");
						cbDP.removeItem("C/Clob(C)");
						cbDP.removeItem("Clob(C)C�b");
						cbDP.removeItem("C�bClob(C)");
						cbDP.removeItem("M(C)");
						cbDP.removeItem("MC'b(C)");
						cbDP.removeItem("F(C)+");
						cbDP.removeItem("F(C)-");
						cbDP.removeItem("F(C)/C");
						cbDP.removeItem("F(C)C'b");
						cbDP.removeItem("C'bF(C)");
						cbDP.removeItem("F(C)C");
						cbDP.removeItem("C/F(C)");						
					}
					if (str=="Dd"||str=="Ddim"||str=="Dde"||str=="Ddi"||str=="Di"||str=="DdDdim"||str=="DdimDd"){
						cbDP.removeItem("M");
						cbDP.removeItem("MC");
						cbDP.removeItem("CM");
						cbDP.removeItem("MC'b");
						cbDP.removeItem("M/C");
						cbDP.removeItem("MClob");
						cbDP.removeItem("MClobC");
						cbDP.removeItem("MClobC'b");
						cbDP.removeItem("MClob(C)C'b");
						cbDP.removeItem("MClob(C)");
						cbDP.removeItem("MClob/C");
						cbDP.removeItem("M(C)");
						cbDP.removeItem("MC(C)");
						cbDP.removeItem("M/C(C)");
						cbDP.removeItem("MC'b(C)");
						cbDP.removeItem("MClob(C)C");
						cbDP.removeItem("MClob(C)/C");
						cbDP.removeItem("MClob(C)C�b");
					}
					if (!str.contains("im")||str=="G simu"){
						cbDP.removeItem("FC'b");
						cbDP.removeItem("C'bF");
						cbDP.removeItem("C'b");
						cbDP.removeItem("MC'b");
						cbDP.removeItem("ClobC'b");
						cbDP.removeItem("C'bClob");
						cbDP.removeItem("ClobC'b");
						cbDP.removeItem("C'bClob");
						cbDP.removeItem("MClobC'b");
						cbDP.removeItem("MClob(C)C'b");
						cbDP.removeItem("F(C)C'b");
						cbDP.removeItem("C'bF(C)");
						cbDP.removeItem("MC'b(C)");
						cbDP.removeItem("MClob(C)C�b");
						cbDP.removeItem("Clob(C)C�b");
						cbDP.removeItem("C�bClob(C)");
					}if (str=="Dr"||str=="DG"||str=="DdG"||str=="DD"||str=="DdD"||str=="DGim"||str=="DdGim"||str=="DGDdim"||str=="DdGDdim"){
						cbDP.removeItem("F+");
					}
					checkQF();
					cbDP.setEnabled(true);
				}
					
			}
		});
		cbComprensione.setModel(new DefaultComboBoxModel(new String[] {"", "G", "D", "Dd", "Dim", "Ddim", "Gim", "ImG", "Da", "Dr", "Dde", "Ddi", "Di", "g", "DG", "DdG", "DD", "DdD", "GDdim", "DdimG", "DDim", "DimD", "DDdim", "DdimD", "DdDim", "DimDd", "DdDdim", "DdimDd", "DGim", "DdGim", "DGDdim", "DdGDdim", "G sinc", "G sint", "G anal", "G simu", "G succ", "G conf", "G cont", "G bil"}));
		cbComprensione.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_13.add(cbComprensione);
		
		JPanel panel_16 = new JPanel();
		panel_16.setFocusable(false);
		panel_16.setBorder(null);
		panel_16.setBounds(240, 270, 140, 48);
		panel.add(panel_16);
		panel_16.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnNumeroLocalizzazione = new JTextPane();
		txtpnNumeroLocalizzazione.setFocusable(false);
		txtpnNumeroLocalizzazione.setVerifyInputWhenFocusTarget(false);
		txtpnNumeroLocalizzazione.setText("Numero Localizzazione");
		txtpnNumeroLocalizzazione.setOpaque(false);
		txtpnNumeroLocalizzazione.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnNumeroLocalizzazione.setEditable(false);
		panel_16.add(txtpnNumeroLocalizzazione);
		
		cbNumeroLocalizzazione = new JComboBox();
		cbNumeroLocalizzazione.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_16.add(cbNumeroLocalizzazione);
		
		JTextPane txtpnDeterminantiPrimarie = new JTextPane();
		txtpnDeterminantiPrimarie.setVerifyInputWhenFocusTarget(false);
		txtpnDeterminantiPrimarie.setText("Determinanti primarie");
		txtpnDeterminantiPrimarie.setOpaque(false);
		txtpnDeterminantiPrimarie.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnDeterminantiPrimarie.setFocusable(false);
		txtpnDeterminantiPrimarie.setEditable(false);
		txtpnDeterminantiPrimarie.setBounds(10, 329, 126, 22);
		panel.add(txtpnDeterminantiPrimarie);
		
		JPanel panel_17 = new JPanel();
		panel_17.setFocusable(false);
		panel_17.setBorder(null);
		panel_17.setBounds(10, 348, 113, 48);
		panel.add(panel_17);
		panel_17.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane textPane_1 = new JTextPane();
		textPane_1.setText("                                 ");
		textPane_1.setVerifyInputWhenFocusTarget(false);
		textPane_1.setOpaque(false);
		textPane_1.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		textPane_1.setFocusable(false);
		textPane_1.setEditable(false);
		panel_17.add(textPane_1);
		
		cbDP = new JComboBox();
		cbDP.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				String str=(String)cbDP.getSelectedItem();
				String strLoc=(String)cbPosizione.getSelectedItem();
				cbTipodp.setSelectedIndex(0);
				cbQADP.setSelectedIndex(0);
				cbDSM.setSelectedIndex(0);
				cbDSC.setSelectedIndex(0);
				cbDSfc.setSelectedIndex(0);
				cbDSc.setSelectedIndex(0);
				cbContenutiPrimari.setSelectedIndex(0);

				cbFrequenze.setSelectedIndex(0);
				if (cbDP.getSelectedIndex()==0){
					cbTipodp.setEnabled(false);
					cbQADP.setEnabled(false);
					cbDSM.setEnabled(false);
					cbDSC.setEnabled(false);
					cbDSfc.setEnabled(false);
					cbDSc.setEnabled(false);
					cbContenutiPrimari.setEnabled(false);
					cbFrequenze.setEnabled(false);
				}else{
					cbTipodp.setEnabled(true);
					cbQADP.setEnabled(true);
					cbDSM.setEnabled(false);
					cbDSC.setEnabled(true);
					cbDSfc.setEnabled(true);
					cbDSc.setEnabled(true);
					cbContenutiPrimari.setEnabled(true);
					cbFrequenze.setEnabled(true);
					if (!str.contains("M")){
						checkQF();
						cbTipodp.setEnabled(false);
						cbDSM.setEnabled(true);
					}else{
						cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"", "A", "H", "Scena"}));
					}
					
					if (str==""||str=="F+"||str=="F-"||str=="F�"||str=="M"||str=="FClob"||str=="ClobF"||str=="Clob"||str=="F(C)+"||str=="F(C)-"||str=="Po"||str=="Num"){
						cbQADP.setEnabled(false);
					}
					if(str.contains("Clob")){
						cbDSc.setEnabled(false);
					}
					if(str.contains("(C)")){
						cbDSfc.setEnabled(false);
					}
					
					
				}			
			}
		});
		cbDP.setModel(new DefaultComboBoxModel(new String[] {"", "F+", "F-", "F\u00B1", "M", "FC", "CF", "C", "FC'b", "C'bF", "C'b", "F/C", "C/F", "CN", "FClob", "ClobF", "Clob", "F(C)+", "F(C)-", "MC", "CM", "MC'b", "M/C", "MClob", "ClobC", "CClob", "ClobC'b", "C'bClob", "Clob/C", "C/Clob", "MClobC", "MClobC'b", "MClob(C)C'b", "M(C)", "F(C)/C", "CF(C)", "Clob(C)", "(C)Clob", "MClob(C)", "MClob/C", "F(C)C'b ", "C'bF(C)", "F(C)C", "C/F(C)", "MC(C)", "M/C(C)", "MC'b(C)", "MClob(C)C", "MClob(C)/C", "MClob(C)C\u2019b", "Clob(C)C ", "CClob(C)", "Clob(C)/C", "C/Clob(C)", "Clob(C)C\u2019b", "C\u2019bClob(C)", "Po", "Num"}));
		cbDP.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_17.add(cbDP);
		
		JPanel panel_18 = new JPanel();
		panel_18.setFocusable(false);
		panel_18.setBorder(null);
		panel_18.setBounds(133, 348, 50, 48);
		panel.add(panel_18);
		panel_18.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnTipo = new JTextPane();
		txtpnTipo.setText("Tipo");
		txtpnTipo.setVerifyInputWhenFocusTarget(false);
		txtpnTipo.setOpaque(false);
		txtpnTipo.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnTipo.setFocusable(false);
		txtpnTipo.setEditable(false);
		panel_18.add(txtpnTipo);
		
		cbTipodp = new JComboBox();
		cbTipodp.setModel(new DefaultComboBoxModel(new String[] {"", "EM", "EF", "EC", "EE", "EA", "E?", "FM", "FF", "FC", "FE", "FA", "F?", "DM", "DF", "DC", "DE", "DA", "D?", "BM", "BF", "BC", "BE", "BA", "B?", "RM", "RF", "RC", "RE", "RA", "R?", "?M", "?F", "?C", "?E", "?A", "Em", "Ef"}));
		cbTipodp.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_18.add(cbTipodp);
		
		JPanel panel_19 = new JPanel();
		panel_19.setFocusable(false);
		panel_19.setBorder(null);
		panel_19.setBounds(189, 348, 44, 48);
		panel.add(panel_19);
		panel_19.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnQa = new JTextPane();
		txtpnQa.setVerifyInputWhenFocusTarget(false);
		txtpnQa.setText("Q.A.");
		txtpnQa.setOpaque(false);
		txtpnQa.setFont(new Font("Book Antiqua", Font.PLAIN, 12));
		txtpnQa.setFocusable(false);
		txtpnQa.setEditable(false);
		panel_19.add(txtpnQa);
		
		cbQADP = new JComboBox();
		cbQADP.setModel(new DefaultComboBoxModel(new String[] {"", "\u2191", "\u2193", "\u2191\u2193"}));
		cbQADP.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		panel_19.add(cbQADP);
		
		JTextPane txtpnDeterminantiSecondarie = new JTextPane();
		txtpnDeterminantiSecondarie.setVerifyInputWhenFocusTarget(false);
		txtpnDeterminantiSecondarie.setText("Determinanti secondarie");
		txtpnDeterminantiSecondarie.setOpaque(false);
		txtpnDeterminantiSecondarie.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnDeterminantiSecondarie.setFocusable(false);
		txtpnDeterminantiSecondarie.setEditable(false);
		txtpnDeterminantiSecondarie.setBounds(288, 329, 184, 22);
		panel.add(txtpnDeterminantiSecondarie);
		
		JPanel panel_20 = new JPanel();
		panel_20.setFocusable(false);
		panel_20.setBorder(null);
		panel_20.setBounds(288, 348, 65, 48);
		panel.add(panel_20);
		panel_20.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnM = new JTextPane();
		txtpnM.setVerifyInputWhenFocusTarget(false);
		txtpnM.setText("m              ");
		txtpnM.setOpaque(false);
		txtpnM.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnM.setFocusable(false);
		txtpnM.setEditable(false);
		panel_20.add(txtpnM);
		
		cbDSM = new JComboBox();
		cbDSM.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				String str=(String)cbDSM.getSelectedItem();
				if(str=="MA"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","A"}));
					cbContenutiPrimari.setSelectedIndex(1);
				}else if(str=="EfH"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","Hd","Masch"}));
					cbContenutiPrimari.setSelectedIndex(0);
				}else if(str=="EfA"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","Ad","Masch"}));
					cbContenutiPrimari.setSelectedIndex(0);
				}else if(str=="pMH"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","H","Scena"}));
					cbContenutiPrimari.setSelectedIndex(0);
				}else if(str=="M'p'H"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","Hd","SexF", "SexM", "SexC", "Sex?"}));
					cbContenutiPrimari.setSelectedIndex(0);
				}else if(str=="M'p'A"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","Ad","SexA"}));
					cbContenutiPrimari.setSelectedIndex(0);
				}else if(str=="MrH"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","Hs","Hds","SexsM", "SexsF", "SexsC", "Sexs?"}));
					cbContenutiPrimari.setSelectedIndex(0);
				}else if(str=="MrA"){
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"","As","Ads", "SexsA", "Sexs?"}));
					cbContenutiPrimari.setSelectedIndex(0);
				}

				else
					cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Ad", "As", "Ads", "H", "Hd", "Hs", "Hds", "Obj", "Anat", "SexF", "SexM", "SexC", "Sex?", "SexA", "SexsM", "SexsF", "SexsC", "Sexs?", "SexsA", "Schel", "Rad", "Patol", "Sang", "Abstr", "Arald", "Arch", "Ark", "Astr", "Biol", "Bot", "Cibo", "Col", "Ele", "Esc", "Espl", "Fig", "Foc", "Geog", "Ghiac", "Masch", "Min", "Nat", "Nub", "Pal", "Paes", "Poz", "Scena", "Sign", "Spo", "Altro", "Carne", "Vorago", "Ombra", "Ven"}));

					
				cbDSMT.setSelectedIndex(0);
				if (cbDSM.getSelectedIndex()==0)
					cbDSMT.setEnabled(false);
				else
					cbDSMT.setEnabled(true);
			}
		});
		cbDSM.setModel(new DefaultComboBoxModel(new String[] {"", "MA", "EfH", "pMH", "EfA", "pMA", "M'p'H", "MrA", "MrH", "M'p'A", "mi"}));
		cbDSM.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_20.add(cbDSM);
		
		JPanel panel_21 = new JPanel();
		panel_21.setFocusable(false);
		panel_21.setBorder(null);
		panel_21.setBounds(359, 348, 44, 48);
		panel.add(panel_21);
		panel_21.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnTipo_1 = new JTextPane();
		txtpnTipo_1.setVerifyInputWhenFocusTarget(false);
		txtpnTipo_1.setText("tipo    ");
		txtpnTipo_1.setOpaque(false);
		txtpnTipo_1.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnTipo_1.setFocusable(false);
		txtpnTipo_1.setEditable(false);
		panel_21.add(txtpnTipo_1);
		
		cbDSMT = new JComboBox();
		cbDSMT.setModel(new DefaultComboBoxModel(new String[] {"", "\u2191", "\u2193", "\u21C5", "\u2195", "\u21BA", "?"}));
		cbDSMT.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_21.add(cbDSMT);


		
		
		JPanel panel_22 = new JPanel();
		panel_22.setFocusable(false);
		panel_22.setBorder(null);
		panel_22.setBounds(413, 348, 59, 48);
		panel.add(panel_22);
		panel_22.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnC = new JTextPane();
		txtpnC.setVerifyInputWhenFocusTarget(false);
		txtpnC.setText("C'");
		txtpnC.setOpaque(false);
		txtpnC.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnC.setFocusable(false);
		txtpnC.setEditable(false);
		panel_22.add(txtpnC);
		
		cbDSC = new JComboBox();
		cbDSC.setModel(new DefaultComboBoxModel(new String[] {"", "FC'n", "C'nF", "C'n"}));
		cbDSC.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_22.add(cbDSC);
		
		JPanel panel_23 = new JPanel();
		panel_23.setFocusable(false);
		panel_23.setBorder(null);
		panel_23.setBounds(484, 348, 65, 48);
		panel.add(panel_23);
		panel_23.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnc = new JTextPane();
		txtpnc.setVerifyInputWhenFocusTarget(false);
		txtpnc.setText("(c)    ");
		txtpnc.setOpaque(false);
		txtpnc.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnc.setFocusable(false);
		txtpnc.setEditable(false);
		panel_23.add(txtpnc);
		
		cbDSfc = new JComboBox();
		cbDSfc.setModel(new DefaultComboBoxModel(new String[] {"", "F(c)+", "F(c)-"}));
		cbDSfc.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_23.add(cbDSfc);
		
		JPanel panel_24 = new JPanel();
		panel_24.setFocusable(false);
		panel_24.setBorder(null);
		panel_24.setBounds(559, 348, 50, 48);
		panel.add(panel_24);
		panel_24.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnC_1 = new JTextPane();
		txtpnC_1.setVerifyInputWhenFocusTarget(false);
		txtpnC_1.setText("c      ");
		txtpnC_1.setOpaque(false);
		txtpnC_1.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnC_1.setFocusable(false);
		txtpnC_1.setEditable(false);
		panel_24.add(txtpnC_1);
		
		cbDSc = new JComboBox();
		cbDSc.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cbDSQA.setSelectedIndex(0);
				if (cbDSc.getSelectedIndex()==0){
					cbDSQA.setEnabled(false);
				}else{
					cbDSQA.setEnabled(true);
				}
					
					
			}
		});
		cbDSc.setModel(new DefaultComboBoxModel(new String[] {"", "Fc", "cF", "c"}));
		cbDSc.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_24.add(cbDSc);
		
		JPanel panel_25 = new JPanel();
		panel_25.setFocusable(false);
		panel_25.setBorder(null);
		panel_25.setBounds(619, 348, 38, 48);
		panel.add(panel_25);
		panel_25.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnQa_1 = new JTextPane();
		txtpnQa_1.setVerifyInputWhenFocusTarget(false);
		txtpnQa_1.setText("Q.A.  ");
		txtpnQa_1.setOpaque(false);
		txtpnQa_1.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnQa_1.setFocusable(false);
		txtpnQa_1.setEditable(false);
		panel_25.add(txtpnQa_1);
		
		cbDSQA = new JComboBox();
		cbDSQA.setModel(new DefaultComboBoxModel(new String[] {"", "\u2191", "\u2193", "\u2191\u2193"}));
		cbDSQA.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_25.add(cbDSQA);
		
		JTextPane txtpnContenuti = new JTextPane();
		txtpnContenuti.setVerifyInputWhenFocusTarget(false);
		txtpnContenuti.setText("Contenuti");
		txtpnContenuti.setOpaque(false);
		txtpnContenuti.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnContenuti.setFocusable(false);
		txtpnContenuti.setEditable(false);
		txtpnContenuti.setBounds(10, 407, 126, 22);
		panel.add(txtpnContenuti);
		
		JPanel panel_26 = new JPanel();
		panel_26.setAlignmentY(Component.TOP_ALIGNMENT);
		panel_26.setFocusable(false);
		panel_26.setBorder(null);
		panel_26.setBounds(10, 429, 95, 85);
		panel.add(panel_26);
		FlowLayout fl_panel_26 = new FlowLayout(FlowLayout.LEFT, 0, 0);
		panel_26.setLayout(fl_panel_26);
		
		JTextPane txtpnPrimari = new JTextPane();
		txtpnPrimari.setVerifyInputWhenFocusTarget(false);
		txtpnPrimari.setText("Primari%         ");
		txtpnPrimari.setOpaque(false);
		txtpnPrimari.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnPrimari.setFocusable(false);
		txtpnPrimari.setEditable(false);
		panel_26.add(txtpnPrimari);
		
		cbContenutiPrimari = new JComboBox();
		cbContenutiPrimari.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (cbContenutiPrimari.getSelectedItem()=="Altro"){
					testoContenutiPrimari.setEnabled(true);
				}else{
					testoContenutiPrimari.setEnabled(false);
				}
				cbContenutiSecondari1.setSelectedIndex(0);
				if (cbContenutiPrimari.getSelectedIndex()==0){
					cbContenutiSecondari1.setEnabled(false);
				}else{
					cbContenutiSecondari1.setEnabled(true);
				}
					
					
			}
		});
		cbContenutiPrimari.setAlignmentY(Component.TOP_ALIGNMENT);
		cbContenutiPrimari.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Ad", "As", "Ads", "H", "Hd", "Hs", "Hds", "Obj", "Anat", "SexF", "SexM", "SexC", "Sex?", "SexA", "SexsM", "SexsF", "SexsC", "Sexs?", "SexsA", "Schel", "Rad", "Patol", "Sang", "Abstr", "Arald", "Arch", "Ark", "Astr", "Biol", "Bot", "Cibo", "Col", "Ele", "Esc", "Espl", "Fig", "Foc", "Geog", "Ghiac", "Masch", "Min", "Nat", "Nub", "Pal", "Paes", "Poz", "Scena", "Sign", "Spo", "Altro", "Carne", "Vorago", "Ombra", "Ven"}));
		cbContenutiPrimari.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_26.add(cbContenutiPrimari);
		
		Component verticalStrut = Box.createVerticalStrut(20);
		verticalStrut.setPreferredSize(new Dimension(0, 40));
		panel_26.add(verticalStrut);
		
		testoContenutiPrimari = new JTextField();
		testoContenutiPrimari.setFont(new Font("Book Antiqua", Font.PLAIN, 11));
		testoContenutiPrimari.setEnabled(false);
		panel_26.add(testoContenutiPrimari);
		testoContenutiPrimari.setColumns(9);
		
		JPanel panel_27 = new JPanel();
		panel_27.setFocusable(false);
		panel_27.setBorder(null);
		panel_27.setAlignmentY(0.0f);
		panel_27.setBounds(115, 429, 479, 85);
		panel.add(panel_27);
		panel_27.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
		
		JTextPane txtpnSecondari = new JTextPane();
		txtpnSecondari.setVerifyInputWhenFocusTarget(false);
		txtpnSecondari.setText("Secondari                                                                                                                              ");
		txtpnSecondari.setOpaque(false);
		txtpnSecondari.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnSecondari.setFocusable(false);
		txtpnSecondari.setEditable(false);
		panel_27.add(txtpnSecondari);
		
		JPanel panel_31 = new JPanel();
		panel_27.add(panel_31);
		GridBagLayout gbl_panel_31 = new GridBagLayout();
		gbl_panel_31.columnWidths = new int[] {90};
		gbl_panel_31.rowHeights = new int[] {25, 25};
		panel_31.setLayout(gbl_panel_31);
		
		cbContenutiSecondari1 = new JComboBox();
		GridBagConstraints gbc_cbContenutiSecondari1 = new GridBagConstraints();
		gbc_cbContenutiSecondari1.anchor = GridBagConstraints.NORTH;
		gbc_cbContenutiSecondari1.insets = new Insets(0, 0, 5, 5);
		gbc_cbContenutiSecondari1.gridx = 0;
		gbc_cbContenutiSecondari1.gridy = 0;
		panel_31.add(cbContenutiSecondari1, gbc_cbContenutiSecondari1);
		cbContenutiSecondari1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (cbContenutiSecondari1.getSelectedItem()=="Altro"){
					testoContenutiSecondari1.setEnabled(true);
				}else{
					testoContenutiSecondari1.setEnabled(false);
				}
				cbContenutiSecondari2.setSelectedIndex(0);
				if (cbContenutiSecondari1.getSelectedIndex()==0){
					cbContenutiSecondari2.setEnabled(false);
				}else{
					cbContenutiSecondari2.setEnabled(true);
				}
			}
		});
		cbContenutiSecondari1.setModel(new DefaultComboBoxModel(new String[] {"", "A", "Abstr", "Ad", "Ads", "Altro", "Anat", "Ano", "Antenne", "Arald", "Arch", "Ark", "Arma", "Art", "As", "Astr", "Becco", "Biol", "Bisex", "Bocca", "Bot", "Carne", "Chele", "Cibo", "Col", "Cop", "Corna", "Denti", "Dita", "Ele", "Ermaf", "Esc", "Espl", "Fab", "Fant", "Fauci", "Feto", "Fig", "Foc", "Forb", "Geog", "Ghiac", "Gioc", "Lingua", "Mano", "Masch", "Mestr", "Min", "Mit", "Mos", "Naso", "Nat", "Nub", "Obj", "Occhi", "Ombra", "Omosex", "Orecchie", "Paes", "Pal", "Patol", "Pelle", "Phi", "Pinze", "Poz", "Prob", "Pung", "Rad", "Relig", "Sang", "Scena", "Schel", "Seno", "Sex?", "SexA", "SexC", "SexF", "SexM", "Sexs?", "SexsC", "SexsF", "SexsM", "Sign", "Spo", "Tenaglie", "Transex", "Travest", "Unghie", "Ven", "Vest", "Vorago", "Zanne"}));
		cbContenutiSecondari1.setFont(new Font("Dialog", Font.PLAIN, 14));
		cbContenutiSecondari1.setAlignmentY(0.0f);
		
		testoContenutiSecondari1 = new JTextField();
		GridBagConstraints gbc_testoContenutiSecondari1 = new GridBagConstraints();
		gbc_testoContenutiSecondari1.insets = new Insets(0, 0, 0, 5);
		gbc_testoContenutiSecondari1.gridx = 0;
		gbc_testoContenutiSecondari1.gridy = 1;
		panel_31.add(testoContenutiSecondari1, gbc_testoContenutiSecondari1);
		testoContenutiSecondari1.setEnabled(false);
		testoContenutiSecondari1.setColumns(10);
		
		JPanel panel_32 = new JPanel();
		panel_27.add(panel_32);
		panel_32.setLayout(new GridLayout(0, 1, 0, 0));
		
		JComboBox comboBox = new JComboBox();
		comboBox.setFont(new Font("Dialog", Font.PLAIN, 14));
		comboBox.setAlignmentY(0.0f);
		panel_32.add(comboBox);
		
		textField_2 = new JTextField();
		textField_2.setEnabled(false);
		textField_2.setColumns(10);
		panel_32.add(textField_2);
		
		JPanel panel_28 = new JPanel();
		panel_28.setFocusable(false);
		panel_28.setBorder(null);
		panel_28.setBounds(10, 525, 81, 48);
		panel.add(panel_28);
		panel_28.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnFrequenze = new JTextPane();
		txtpnFrequenze.setVerifyInputWhenFocusTarget(false);
		txtpnFrequenze.setText("Frequenze");
		txtpnFrequenze.setOpaque(false);
		txtpnFrequenze.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnFrequenze.setFocusable(false);
		txtpnFrequenze.setEditable(false);
		panel_28.add(txtpnFrequenze);
		
		cbFrequenze = new JComboBox();
		cbFrequenze.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
					
			}
		});
		cbFrequenze.setModel(new DefaultComboBoxModel(new String[] {"", "V", "(V)", "O+", "O\u00B1", "O-", "(O+)", "(O\u00B1)", "(O-)", "", "(V)(O+)", "(V)(O\u00B1)"}));
		cbFrequenze.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_28.add(cbFrequenze);
		
		JPanel panel_29 = new JPanel();
		panel_29.setFocusable(false);
		panel_29.setBorder(null);
		panel_29.setBounds(10, 270, 44, 48);
		panel.add(panel_29);
		panel_29.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		
		JTextPane txtpnQf = new JTextPane();
		txtpnQf.setVerifyInputWhenFocusTarget(false);
		txtpnQf.setText("Q.F.   ");
		txtpnQf.setOpaque(false);
		txtpnQf.setFont(new Font("Dialog", Font.PLAIN, 12));
		txtpnQf.setFocusable(false);
		txtpnQf.setEditable(false);
		panel_29.add(txtpnQf);
		
		cbQFrequenze = new JComboBox();
		cbQFrequenze.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cbComprensione.setModel(new DefaultComboBoxModel(new String[] {"", "G", "D", "Dd", "Dim", "Ddim", "Gim", "ImG", "Da", "Dr", "Dde", "Ddi", "Di", "g", "DG", "DdG", "DD", "DdD", "GDdim", "DdimG", "DDim", "DimD", "DDdim", "DdimD", "DdDim", "DimDd", "DdDdim", "DdimDd", "DGim", "DdGim", "DGDdim", "DdGDdim", "G sinc", "G sint", "G anal", "G simu", "G succ", "G conf", "G cont", "G bil"}));
				cbDP.setModel(new DefaultComboBoxModel(new String[] {"", "F+", "F-", "F\u00B1", "M", "FC", "CF", "C", "FC'b", "C'bF", "C'b", "F/C", "C/F", "CN", "FClob", "ClobF", "Clob", "F(C)+", "F(C)-", "MC", "CM", "MC'b", "M/C", "MClob", "ClobC", "CClob", "ClobC'b", "C'bClob", "Clob/C", "C/Clob", "MClobC", "MClobC'b", "MClob(C)C'b", "M(C)", "F(C)/C", "CF(C)", "Clob(C)", "(C)Clob", "MClob(C)", "MClob/C", "F(C)C'b", "C'bF(C)", "F(C)C", "C/F(C)", "MC(C)", "M/C(C)", "MC'b(C)", "MClob(C)C", "MClob(C)/C", "MClob(C)C\u2019b", "Clob(C)C", "CClob(C)", "Clob(C)/C", "C/Clob(C)", "Clob(C)C\u2019b", "C\u2019bClob(C)", "Po", "Num"}));
				cbComprensione.setSelectedIndex(0);
				checkQF();
				
					
			}
		});
		cbQFrequenze.setModel(new DefaultComboBoxModel(new String[] {"", "+", "\u00B1", "-"}));
		cbQFrequenze.setFont(new Font("Dialog", Font.PLAIN, 14));
		panel_29.add(cbQFrequenze);
		
		cbQFrequenze.setSelectedIndex(0);
		
		JPanel panel_30 = new JPanel();
		panel_30.setBackground(Color.ORANGE);
		panel_30.setBounds(278, 329, 402, 77);
		panel.add(panel_30);
		
		JButton btnPdf = new JButton("PDF");
		btnPdf.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				PDFGenerator pdf = new PDFGenerator();
			}
		});
		btnPdf.setBounds(184, 406, 89, 23);
		panel.add(btnPdf);
		
		JButton btnSalva = new JButton("Salva");
		btnSalva.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		btnSalva.setFont(new Font("Book Antiqua", Font.PLAIN, 14));
		btnSalva.setBounds(619, 428, 89, 23);
		panel.add(btnSalva);
		
		list = new JList();
		list.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				JList list= (JList)e.getComponent();
				Interpretazione interpretazione = (Interpretazione)list.getSelectedValue();
				
			}
		});
		list.setBounds(101, 525, 336, 69);
		panel.add(list);
		
		JButton btnSalva_1 = new JButton("Salva");
		btnSalva_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		btnSalva_1.setBounds(447, 525, 89, 23);
		panel.add(btnSalva_1);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setBounds(404, 257, 173, 61);
		panel.add(tabbedPane);
		
		JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane_1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
			}
		});
		tabbedPane.addTab("New tab", null, tabbedPane_1, null);
	}
}
